/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

import request from "@/router/axios";

export function fetchList(query) {
  return request({
    url: "/car/crcar/page",
    method: "get",
    params: query
  });
}

export function addObj(obj) {
  return request({
    url: "/car/crcar",
    method: "post",
    data: obj
  });
}

export function getObj(id) {
  return request({
    url: "/car/crcar/" + id,
    method: "get"
  });
}

export function delObj(id) {
  return request({
    url: "/car/crcar/" + id,
    method: "delete"
  });
}

export function putObj(obj) {
  return request({
    url: "/car/crcar",
    method: "put",
    data: obj
  });
}

export function exportExcel(obj) {
  return request({
    url: "/car/crcar/export",
    method: "get",
    params: obj,
    responseType: "blob"
  });
}

export function Line(obj) {
  return request({
    url: "/car/crcar/line",
    method: "get",
    params: obj
  });
}
// 确认出场
export function CarOut(data) {
  return request({
    url: "/car/crcar/out/" + data.id,
    method: "get",
    params: data
  });
}

export function CrCarType(data) {
  return request({
    url: "car/crcar/type/" + data,
    method: "get",
    params: {}
  });
}

export function carCompany(data) {
  return request({
    url: "/car/crcar/company",
    method: "get",
    params: {}
  });
}
/* 优惠卷 */
export function carCoupons(params) {
  return request({
    url: "/config/sysCouponInfo/page",
    method: "get",
    params
  });
}
/* 优惠对象 */
export function carobject() {
  return request({
    url: "/config/syscompany/getCompanyByPhone",
    method: "get",

  });
}

/* 优惠类型 */
export function Preferentialtype(id) { //公司名称config/sysCouponInfo/export
  return request({
    url: `/admin/dict/type/${id}`,
    method: "get",

  });
}
/* 导出优惠卷 */
export function exporlist(params) { //新增config/sysCouponInfo
  return request({
    url: `/config/sysCouponInfo/export`,
    method: "get",
    params,
    responseType: 'blob'

  });
}
/* 新增优惠卷 */
export function addcarCoupons(obj) { //新增config/sysCouponInfo
  return request({
    url: `/config/sysCouponInfo`,
    method: "post",
    data: obj

  });
}
/* 删除 */

export function deleteCoupons(id) { //新增config/sysCouponInfo
  return request({
    url: `/config/sysCouponInfo/${id}`,
    method: "DELETE",
});
}
/* 编辑 */
export function edtCoupons1(obj) { //新增config/sysCouponInfo
  return request({
    url: `/config/sysCouponInfo/`,
    method: "PUT",
    data:obj
});
}
export function syscompany(data) { //临停车分页列表
  return request({
    url: "/car/crcartempfree/page",
    method: "get",
    params:data
  });
}
// export function syscompany(data) { //临停车分页列表
//   return request({
//     url: "/config/syscompany/page",
//     method: "get",
//     params:data
//   });
// }
export function queryCondition(data) { //临停车查看明细
  return request({
    url: "/car/crcartempfree/page/detail",
    method: "get",
    params:data
  });
}
export function getCompanyName() { //公司名称
  return request({
    url: "/config/syscompany/getCompanyByPhone",
    method: "get",
  });
}
export function getPancun(params) { //根据车架号查找车辆
  return request({
    url: "/car/crcar/pancun/detail",
    method: "get",
    params
  });
}
export function enterAnArena(id) { //根据车架号查找车辆
  return request({
    url: `/car/crcar/out/${id}`,
    method: "get",
  });
}






